unit Map_CASHS;

interface
 
uses
  SysUtils, Classes, ADODB, DB, DataEngine, Class_CASHS;

type
  TMap_CASHS = class(TDataEngine)
  public
    function ReadDS(AADODst: TADODataSet): TBaseClass; override;
    function GetStrsIndex(ABaseClass: TBaseClass): string; override;

    function GetStrInsert: string; override;
    function GetStrUpdate: string; override;
    function GetStrDelete: string; override;
    procedure SetParameters(ABaseClass: TBaseClass); override;

    function GetCASHS(CodeA: string; CASHSStrsListA: TStringList): TCASHS;
  end;

implementation

{ TMap_CASHS }

function TMap_CASHS.GetCASHS(CodeA: string;
  CASHSStrsListA: TStringList): TCASHS;
var
  I: Integer;
begin
  Result := nil; 
  if CodeA = '' then Exit;
  for I := 0 to CASHSStrsListA.Count - 1 do
  begin
    if TCASHS(CASHSStrsListA.Objects[I]).CASHID = CodeA then
    begin
      Result := TCASHS(CASHSStrsListA.Objects[I]);
      Exit;
    end;
  end;
end;

function TMap_CASHS.GetStrDelete: string;
begin
  Result := '';
end;

function TMap_CASHS.GetStrInsert: string;
begin
  Result := '';
end;

function TMap_CASHS.GetStrsIndex(ABaseClass: TBaseClass): string;
begin
  Result := '';
end;

function TMap_CASHS.GetStrUpdate: string;
begin
  Result := '';
end;

function TMap_CASHS.ReadDS(AADODst: TADODataSet): TBaseClass;
var
  FieldA: TField;
begin
  Result := TCASHS.Create;
  with TCASHS(Result) do
  begin
    CASHID := AADODst.FieldByName('CASHID').AsString;
    CASHNAME := AADODst.FieldByName('CASHNAME').AsString;

    FieldA := AADODst.FindField('CASHCLASS');
    if FieldA <> nil then
    begin
      CASHCLASS := FieldA.AsString;
    end else
    begin
      CASHCLASS := '';
    end;
  end;
end;

procedure TMap_CASHS.SetParameters(ABaseClass: TBaseClass);
begin
  inherited;

end;

end.
